<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="statusScriptParms" styleClass="edit">

        <rich:panel>
            <f:facet name="header">#{statusScriptParmsHome.managed ? 'Edit' : 'Add'} Status script parms</f:facet>




            <s:decorate id="scriptParmNameField" template="layout/edit.xhtml">
                <ui:define name="label">Script parm name</ui:define>
                <h:inputText id="scriptParmName"
                       required="true"
                           size="32"
                      maxlength="32"
                          value="#{statusScriptParmsHome.instance.scriptParmName}">
                    <a:support event="onblur" reRender="scriptParmNameField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="scriptParmValueField" template="layout/edit.xhtml">
                <ui:define name="label">Script parm value</ui:define>
                <h:inputText id="scriptParmValue"
                       required="true"
                           size="100"
                      maxlength="100"
                          value="#{statusScriptParmsHome.instance.scriptParmValue}">
                    <a:support event="onblur" reRender="scriptParmValueField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>

            <div style="clear:both">
                <span class="required">*</span>
                required fields
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Save"
                         action="#{statusScriptParmsHome.persist}"
                       disabled="#{!statusScriptParmsHome.wired}"
                       rendered="#{!statusScriptParmsHome.managed}"/>

            <h:commandButton id="update"
                          value="Save"
                         action="#{statusScriptParmsHome.update}"
                       rendered="#{statusScriptParmsHome.managed}"/>

            <h:commandButton id="delete"
                          value="Delete"
                         action="#{statusScriptParmsHome.remove}"
                      immediate="true"
                       rendered="#{statusScriptParmsHome.managed}"/>

            <s:button id="cancelEdit"
                   value="Cancel"
             propagation="end"
                    view="/StatusScriptParms.xhtml"
                rendered="#{statusScriptParmsHome.managed}"/>

            <s:button id="cancelAdd"
                   value="Cancel"
             propagation="end"
                    view="/#{empty statusScriptParmsFrom ? 'StatusScriptParmsList' : statusScriptParmsFrom}.xhtml"
                rendered="#{!statusScriptParmsHome.managed}"/>

        </div>
    </h:form>

<rich:tabPanel switchType="ajax">

    <rich:tab label="Status actions script *" labelClass="required">
    <div class="association" id="statusActionsScriptParent">

        <h:outputText value="There is no statusActionsScript associated with this statusScriptParms."
                   rendered="#{statusScriptParmsHome.instance.statusActionsScript == null}"/>

        <rich:dataTable var="_statusActionsScript"
                   value="#{statusScriptParmsHome.instance.statusActionsScript}"
                rendered="#{statusScriptParmsHome.instance.statusActionsScript != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="statusActionsScriptTable">
            <h:column>
                <f:facet name="header">Status actions script id</f:facet>
                <h:outputText value="#{_statusActionsScript.statusActionsScriptId}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Device actions device actions id</f:facet>
                <h:outputText value="#{_statusActionsScript.deviceActions.deviceActionsId}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Status actions status action id</f:facet>
                <h:outputText value="#{_statusActionsScript.statusActions.statusActionId}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Order</f:facet>
                <h:outputText value="#{_statusActionsScript.order}"/>
            </h:column>
        </rich:dataTable>

        <div class="actionButtons">
            <s:button id="#{statusScriptParmsHome.instance.statusActionsScript != null ? 'changeParent' : 'selectParent'}" value="#{statusScriptParmsHome.instance.statusActionsScript != null ? 'Change' : 'Select'} statusActionsScript"
                       view="/StatusActionsScriptList.xhtml">
                <f:param name="from" value="StatusScriptParmsEdit"/>
            </s:button>
        </div>

    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
